<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:substituteby="template::docHead(#{system.name},'服务管理')">
</head>
<body>
<script type="text/javascript" th:substituteby="system/authorization/svrlist.js::js"></script>
<nav th:replace="template::nav"></nav>
<div class="container-fluid">
    <div class="row">
        <div class="col-sm-12 col-md-12 main">
            <nav class="navbar navbar-default">
                <div class="container-fluid">
                    <div class="navbar-header">
                        <button type="button" class="navbar-toggle collapsed" data-toggle="collapse"
                                data-target="#bs-example-navbar-collapse-2" aria-expanded="false">
                            <span class="sr-only">Toggle navigation</span>
                            <span class="icon-bar"></span>
                            <span class="icon-bar"></span>
                            <span class="icon-bar"></span>
                        </button>
                        <a class="navbar-brand" href="#">服务管理：</a>
                    </div>
                    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-2">
                        <button type="button" class="btn btn-primary navbar-btn" data-toggle="modal"
                                data-target="#myModal">
                            <span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
                            创建服务
                        </button>
                        <form class="navbar-form navbar-right" role="search" th:action="@{./users}">
                            <div class="form-group">
                                <input type="text" class="form-control" placeholder="查询" id="userName" name="userName"/>
                            </div>
                            <button type="submit" class="btn btn-default">查询</button>
                        </form>
                    </div>
                </div>
            </nav>

            <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
                 aria-hidden="true">
                <div class="modal-dialog" style="width: 400px;">
                    <div class="modal-content">
                        <div class="modal-header">
                            <button type="button" class="close"
                                    data-dismiss="modal" aria-hidden="true">
                                &times;
                            </button>
                            <h4 class="modal-title" id="myModalLabel">
                                创建商户服务
                            </h4>
                        </div>
                        <form th:action="@{./users}" method="post">
                            <div class="modal-body">
                                <div class="input-group" style="margin-bottom: .5em;">
                                    <span class="input-group-addon" id="basic-username">AppId</span>
                                    <input type="text" id="addUserName" name="appid" class="form-control"
                                           placeholder="AppId"
                                           aria-describedby="basic-username"/>
                                </div>
                                <div class="input-group" style="margin-bottom: .5em;">
                                    <span class="input-group-addon" id="basic-AppSecret">AppSecret</span>
                                    <input type="text" id="AppSecret" name="appid" class="form-control"
                                           placeholder="AppSecret"
                                           aria-describedby="basic-username"/>
                                </div>
                                <div class="input-group" style="margin-bottom: .5em;">
                                    <span class="input-group-addon" id="basic-gzNo">公众号微信</span>
                                    <input type="text" id="gzNo" name="gzNo" class="form-control"
                                           placeholder="公众号微信"
                                           aria-describedby="basic-username"/>
                                </div>
                                <label>选择商户</label>

                                <div>
                                    <div th:each="role:${roles}" class="checkbox-inline">
                                        <label>
                                            <input type="checkbox" th:value="${role.rolename}"
                                                   name="roles"/><span th:text="${role.rolename}"/>
                                        </label>
                                    </div>
                                </div>
                            </div>
                            <div class="modal-footer">
                                <button type="button" class="btn btn-default"
                                        data-dismiss="modal">关闭
                                </button>
                                <button type="button" class="btn btn-primary">
                                    确定
                                </button>
                            </div>
                        </form>
                    </div><!-- /.modal-content -->
                </div><!-- /.modal -->
            </div>

            <div class="table-responsive">
                <table class="table table-striped">
                    <thead>
                    <tr>
                        <th>序号</th>
                        <th>公众号</th>
                        <th>商户名称</th>
                        <th>公众号appid</th>
                        <th>公众号appsecret</th>
                        <th>创建时间</th>
                        <th>是否有效</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <!--<tr th:each="result:${result.result}">-->
                        <!--<td th:text="${result.id}"></td>-->
                        <!--<td th:text="${result.name}"></td>-->
                        <!--<td th:text="${result.group.name}"></td>-->
                        <!--<td th:text="${result.appid}"></td>-->
                        <!--<td th:text="${result.appsecret}"></td>-->
                        <!--<td th:text="${result.createTime}"></td>-->
                        <!--<td th:switch="${result.state}">-->
                            <!--<span th:case="0">有效</span>-->
                            <!--<span th:case="1">无效</span>-->
                        <!--</td>-->
                        <!--<td>-->
                            <!--<button type="button" class="btn btn-xs btn-info" th:onclick="'showUser('+${result.id}+')'">-->
                                <!--<span class="glyphicon glyphicon-edit" aria-hidden="false"></span>-->
                            <!--</button>-->
                            <!--&nbsp;&nbsp;-->
                            <!--<button type="button" class="btn btn-xs btn-danger"-->
                                    <!--th:onclick="'confirmDelUser(\''+${result.id}+'\','+${result.id}+')'">-->
                                <!--<span class="glyphicon glyphicon-remove" aria-hidden="false"></span>-->
                            <!--</button>-->
                        <!--</td>-->
                    <!--</tr>-->
                    </tbody>
                </table>

            </div>
        </div>
    </div>
</div>
</body>
</html>
